实现手持终端条码的扫描,储存,判断 条码内容判定,条码是否重码报警 手持终端的当前只能在VS2008 2005上编程 高版本VS不适用 该示例用的VS2008 请用该版本打开和继续适应性开发 储存用的TXT文本 数据10万条以上会有判断延迟出现,需要定期清理txt手动备份
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
StreamWriter sw = new StreamWriter(saveFileDialog1.FileName, true);
//sw.WriteLine(listViewMain.Items[4].SubItems[2].Text);
sw.WriteLine(listViewMain.Items[1].SubItems[2].Text);
sw.Close();
}
else
{
StreamWriter sw = new StreamWriter(saveFileDialog1.FileName, true);
//sw.WriteLine(listViewMain.Items[4].SubItems[2].Text);
sw.WriteLine(listViewMain.Items[1].SubItems[2].Text);
sw.Close();
}
//////////////////////////////////////////////////////////
if (textBox3.Text == "OK" && textBox4.Text == "无重码")
{
listViewMain.Enabled = true;
timer1.Enabled = false;
}
else
{
label5.Visible = true;
label7.Visible = true;
listViewMain.Enabled = false;
reloadLastListView();
//SoundPlayer player = new SoundPlayer();
player.SoundLocation = @"alarm.wav";
player.Load(); //同步加载声音
player.Play(); //启用新线程播放
//player.PlayLooping(); //循环播放模式
//player.Stop();
}
if (string.Equals(textBox1.Text, data1.ToString()))
{
textBox3.Text = "OK";
pictureBox1.Visible = true;
pictureBox2.Visible = false;
textBox4.Text = "不检查重码";
pictureBox3.Visible = false;
pictureBox4.Visible = false;
}
else
{
textBox3.Text = "车种错误";
pictureBox1.Visible = false;
pictureBox2.Visible = true;
textBox4.Text = "不检查重码";
pictureBox3.Visible = false;
pictureBox4.Visible = false;
}
if (textBox3.Text == "OK" && textBox4.Text == "不检查重码")
{
listViewMain.Enabled = true;
timer1.Enabled = false;
}
else if (textBox3.Text == "车种错误" && textBox4.Text == "不检查重码")
{
label5.Visible = true;
label7.Visible = true;
listViewMain.Enabled = false;
reloadLastListView();
//SoundPlayer player = new SoundPlayer();
//player.SoundLocation = @"alarm.wav";
player.SoundLocation = @"alarm.wav";
player.Load(); //同步加载声音
player.Play(); //启用新线程播放
//player.PlayLooping(); //循环播放模式
//player.Stop();
}
评论